package edu.sfsu.powerrangers.jeopardy.editor;

import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import javax.swing.JMenuItem;
import javax.swing.KeyStroke;

public class CloseMenuItem extends JMenuItem {
	private static final long serialVersionUID = 1L;
	
	public CloseMenuItem(final EditorFrame ef) {
		super("Close");
		setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_W, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
		addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				ef.dispose();
			}
		});
	}
}
